package com.ruoyi.system.mapper;


import com.ruoyi.system.domain.Dynamic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DynamicMapper {

    int saveDynamic(Dynamic dynamic);

    void deleteDynamic(Long id);
    List<Dynamic> findByParentId(@Param("parentCommentId") Long parentCommentId);
    List<Dynamic> findByDynamicIdParentIdNull(
            @Param("dynamicId") Long dynamicId, @Param("dynamicParentId") Long dynamicParentId);

    List<Dynamic> findByDynamicIdParentIdNotNull(
            @Param("dynamicId") Long dynamicId, @Param("id") Long id);

    List<Dynamic> findByDynamicIdAndReplayId(
            @Param("dynamicId") Long blogId,@Param("childId") Long childId);

    List<Dynamic> findByUserIdParentIdNull(
            @Param("userId") Long userId, @Param("dynamicParentId") Long dynamicParentId);

    List<Dynamic> findByUserIdParentIdNotNull(
            @Param("userId") Long userId, @Param("id") Long id);

    List<Dynamic> findByUserIdAndReplayId(
            @Param("userId") Long userId,@Param("childId") Long childId);
}
